package demo

import (
    "fmt"
    "io/ioutil"

    aepapi "gitee.com/dell_software_department/ctwing_sdk/apis/Aep_edge_gateway"
)

func DeleteEdgeInstanceDevice_Demo() {
    resp, err := aepapi.DeleteEdgeInstanceDevice("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("DeleteEdgeInstanceDevice err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryEdgeInstanceDevice_Demo() {
    resp, err := aepapi.QueryEdgeInstanceDevice("dFI1lzE0EN2", "xQcjrfNLvQ", "", "", "")

    if err != nil {
        fmt.Println("QueryEdgeInstanceDevice err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func CreateEdgeInstance_Demo() {
    resp, err := aepapi.CreateEdgeInstance("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("CreateEdgeInstance err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func EdgeInstanceDeploy_Demo() {
    resp, err := aepapi.EdgeInstanceDeploy("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("EdgeInstanceDeploy err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func DeleteEdgeInstance_Demo() {
    resp, err := aepapi.DeleteEdgeInstance("dFI1lzE0EN2", "xQcjrfNLvQ", "")

    if err != nil {
        fmt.Println("DeleteEdgeInstance err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func AddEdgeInstanceDevice_Demo() {
    resp, err := aepapi.AddEdgeInstanceDevice("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("AddEdgeInstanceDevice err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func AddEdgeInstanceDrive_Demo() {
    resp, err := aepapi.AddEdgeInstanceDrive("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("AddEdgeInstanceDrive err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
